package com.example.demo.Service.ServiceImpl;

import com.example.demo.Entity.User;
import com.example.demo.Mapper.UserMapper;
import com.example.demo.Service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserServiceImpl implements UserService {
    @Autowired
    private UserMapper userMapper;

    @Override
    public User FindById(Integer id) {
        return userMapper.FindById(id);
    }

    @Override
    public User FindByName(String name) {
        return userMapper.FindByName(name);
    }

    @Override
    public List<User> FindAll() {
        return userMapper.FindAll();
    }

    @Override
    public void Save(User user) {
        userMapper.Insert(user);
    }

    @Override
    public void DeleteById(Integer id) {
        userMapper.DeleteById(id);
    }

    @Override
    public void Update(User user) {
        userMapper.Update(user);
    }
}
